function ff = findfirst(varargin)
% findfirst  - find first (or last) element != 0 in input
%
% FORMAT:         ff = findfirst(v [, spos]);
%
% Input fields:      
%
%       v             vector
%       spos          start position for search (default: 1),
%                     if negative do search from end to begin
%
% Output fields:     
%
%       ff            first occurrance of "true" in v (as of spos)

% Version:  v0.7g
% Build:    9100716
% Date:     Oct-07 2009, 4:57 PM CEST
% Author:   Jochen Weber, SCAN Unit, Columbia University, NYC, NY, USA
% URL/Info: http://wiki.brainvoyager.com/BVQXtools
       
% simply bail out
error( ...
    'BVQXtools:MEXMissing', ...
    'This is a compiled function, but the MEX file is missing.' ...
);
